package rewardlog

import "yundian/internel/pkg/dingo"

type RewardAttr func(model *RewardLog)

type RewardAttrs []RewardAttr

func (attrFunc RewardAttrs) Apply(model *RewardLog)  {
	for _,f := range attrFunc {
		f(model)
	}
}

func WithId(id int) RewardAttr {
	return func(model *RewardLog) { model.Id = id }
}

func WithMoney(money int64) RewardAttr {
	return func(model *RewardLog) { model.Money = money }
}

func WithProfitRoportion(profitRoportion int8) RewardAttr {
	return func(model *RewardLog) { model.ProfitRoportion = profitRoportion }
}

func WithUserPid(userId int) RewardAttr {
	return func(model *RewardLog) { model.UserPid = userId }
}

func WithUserPname(userName string) RewardAttr {
	return func(model *RewardLog) { model.UserPname = userName }
}

func WithSettMoney(settMoney int64) RewardAttr {
	return func(model *RewardLog) { model.SettMoney = settMoney }
}

func WithUserId(userId int) RewardAttr {
	return func(model *RewardLog) { model.UserId = userId }
}

func WithUserName(userName string) RewardAttr {
	return func(model *RewardLog) { model.UserName = userName }
}

func WithCreateAt(createAt dingo.Time) RewardAttr {
	return func(model *RewardLog) { model.CreateAt = createAt }
}

func WithUpdateAt(updateAt dingo.Time) RewardAttr {
	return func(model *RewardLog) { model.UpdateAt = updateAt }
}

func WithPlaceId(placeId int) RewardAttr {
	return func(model *RewardLog) { model.PlaceId = placeId }
}

func WithPlaceName(placeName string) RewardAttr {
	return func(model *RewardLog) { model.PlaceName = placeName }
}

func WithDeviceSn(deviceSn string) RewardAttr {
	return func(model *RewardLog) { model.DeviceSn = deviceSn }
}



